<?php

Yii::import('zii.widgets.CPortlet');

class TagCloud extends CPortlet
{

        public $title = 'Tgas';
        public $maxTags = 20;

        protected function renderContent()
        {
                $tags = Tag::model()->findAll();
                foreach ($tags as $tag)
                {
                        $link = CHtml::link(CHtml::encode($tag->name.'('.$tag->frequency.')'), array('post/index', 'tag' => $tag->name));
                        echo CHtml::tag('span', array(
                            'class' => 'tag',
                                ), $link) . "\n";
//                        $link ='<a class="tag" href="/post/index?tag='.$tag->id.'">'."$tag->name($tag->frequency)".'</a>';
//                        echo $link;
                }
        }

}